
import java.io.*;

public class ExtraFastCopy {

   public static void copy(String from, String to) 
                                 throws IOException{
         InputStream in = null;
         OutputStream out = null; 
         try {
            in = new FileInputStream(from);
            out = new FileOutputStream(to);
            int length = in.available(); // danger!
            byte[] bytes = new byte[length];
            in.read(bytes);
            out.write(bytes);         
         } finally {
            if (in != null) {
               in.close();
            }
            if (out != null) {
               out.close();
            }
         }
      }

      public static void main(String[] args) {
         try {
            Stopwatch timer = new Stopwatch().start();
            for (int i = 0; i < 20; i++) {
               copy(args[0], args[1]);
            }
            timer.stop();
            System.out.println(timer.getElapsedTime()/20);
         } catch (IOException e) {
            e.printStackTrace();
         }
      }
   }   
   
